Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[data.indexPatterns] Fix broken rollup index pattern creation #76593

Merged
merged 2 commits into from
Sep 3, 2020

Conversation

lukeelmers
Copy link
Member

Creating rollup-based index patterns is currently broken: the _fetch_fields_for_wildcard route returns a 400 due to a missing rollup_index param. Rollup index patterns are successfully created, but fields are unable to be retrieved, making them useless in most scenarios.

Surprisingly, it was a result of this small PR: #76004

It turns out that the typeMeta -- which is the extension point used by rollups to customize index pattern behavior -- was accidentally serialized as the index pattern mapping instead of the actual typeMeta:

typeMeta: this.mapping.typeMeta._serialize!(this.mapping),

The missing typeMeta resulted in an improperly formatted saved index pattern object, which ultimately didn’t send the correct parameters when looking up fields on the rollup index as it couldn't read the meta it needed.

If you're like me, you are probably wondering, "hey, why don't we have a functional test for this case?" The answer to that question is, we do. But unfortunately, it didn't have any assertions to ensure the newly-created rollup index pattern could actually be retrieved. As a result, the test runner had no idea the error was even happening.

This PR fixes the typo, and also updates the functional test to ensure that (A) No toasts appear after index pattern creation, which might indicate an error; and (B) The expected fields for the new index pattern are displayed in the UI.

Unblocks #75943

@lukeelmers lukeelmers added regression Feature:Data Views Data Views code and UI - index patterns before 8.0 v8.0.0 Team:AppArch release_note:skip Skip the PR/issue when compiling release notes v7.10.0 labels Sep 3, 2020
@lukeelmers lukeelmers requested a review from mattkime September 3, 2020 04:28
@lukeelmers lukeelmers requested a review from a team as a code owner September 3, 2020 04:28
@lukeelmers lukeelmers self-assigned this Sep 3, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch (Team:AppArch)

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

page load bundle size

id value diff baseline
data 1.4MB +1.0B 1.4MB

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@lizozom lizozom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and LGTM

Copy link
Contributor

@mattkime mattkime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@lukeelmers lukeelmers merged commit 64b7726 into elastic:master Sep 3, 2020
@lukeelmers lukeelmers deleted the fix/index-pattern-rollup branch September 3, 2020 14:13
lukeelmers added a commit to lukeelmers/kibana that referenced this pull request Sep 3, 2020
gmmorris added a commit to gmmorris/kibana that referenced this pull request Sep 3, 2020
* master: (340 commits)
  [data.search.SearchSource] Remove legacy ES client APIs. (elastic#75943)
  [release notes] automatically retry on Github API 5xx errors (elastic#76447)
  [es_ui_shared] Fix eslint exhaustive deps rule (elastic#76392)
  [i18n] Integrate 7.9.1 Translations (elastic#76391)
  [APM] Update aggregations to support script sources (elastic#76429)
  [Security Solution] Refactor Network Top Countries to use Search Strategy (elastic#76244)
  Document security settings available on ESS (elastic#76513)
  [Ingest Manager] Add input revision to the config send to the agent (elastic#76327)
  [DOCS] Identifies cloud settings for Monitoring (elastic#76579)
  [DOCS] Identifies Cloud settings in Dev Tools (elastic#76583)
  [Ingest Manager] Better default value for fleet long polling timeout (elastic#76393)
  [data.indexPatterns] Fix broken rollup index pattern creation (elastic#76593)
  [Ingest Manager] Split Registry errors into Connection & Response (elastic#76558)
  [Security Solution] add an excess validation instead of the exact match (elastic#76472)
  Introduce TS incremental builds & move src/test_utils to TS project  (elastic#76082)
  fix bad merge (elastic#76629)
  [Newsfeed] Ensure the version format when calling the API (elastic#76381)
  remove server_extensions mixin (elastic#76606)
  Remove legacy applications and legacy mode (elastic#75987)
  [Discover] Fix sidebar element focus behavior when adding / removing columns (elastic#75749)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Data Views Data Views code and UI - index patterns before 8.0 regression release_note:skip Skip the PR/issue when compiling release notes v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants